<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户管理</title>
<%@ include file="/resources/jsp/rootPath.jsp"%>
</head>
<body>
	<%@ include file="/resources/jsp/header.jsp"%>

	<!-- content start -->
	<div class="am-cf admin-main">
		<%@ include file="/resources/jsp/left.jsp"%>
		<!-- content start -->
		<div class="admin-content">
			<div class="am-cf am-padding">
				<div class="am-cf am-padding">
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">用户管理</strong> / <small>SysOrgPerson</small>
					</div>
				</div>
				<form action="${root}/sys/organization/sysOrgPerson.do"
					method="post">
					<div class="am-g">
						<div class="am-u-sm-12 am-u-md-6">
							<div class="am-btn-toolbar">
								<div class="am-btn-group am-btn-group-xs">
									<button type="button" class="am-btn am-btn-default"
										onclick="add()"
										data-am-modal="{target: '#doc-modal-1', closeViaDimmer: 0, width: 800, height: 625}">
										<span class="am-icon-plus"></span> 新增
									</button>
								</div>
							</div>
						</div>
						<div class="am-u-sm-12 am-u-md-3">
							<div class="am-input-group am-input-group-sm">
								<input type="text" name="fdName" class="am-form-field" value="${fdName }"
									placeholder="输入用户名"> <span class="am-input-group-btn">
									<button class="am-btn am-btn-default" type="submit">搜索</button>
								</span>
							</div>
						</div>
					</div>
				</form>
				<div class="am-g">
					<div class="am-u-sm-12">
						<form class="am-form">
							<table
								class="am-table am-table-striped am-table-hover table-main">
								<thead>
									<tr>
										<th class="table-check"><input type="checkbox" /></th>
										<th class="table-title">用户名</th>
										<th class="table-type">登录名</th>
										<th class="table-author am-hide-sm-only">创建日期</th>
										<th class="table-date am-hide-sm-only">修改日期</th>
										<th class="table-set">操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${page.rows }" var="model">
										<tr>
											<td><input type="checkbox" /></td>
											<td><a href="#">${model.fdName }</a></td>
											<td>${model.fdLoginName }</td>
											<td class="am-hide-sm-only">${model.fdCreateTime }</td>
											<td class="am-hide-sm-only">${model.fdAlterTime }</td>
											<td>
												<div class="am-btn-toolbar">
													<div class="am-btn-group am-btn-group-xs">
														<button type="button" onclick="edit('${model.fdId }')"
															class="am-btn am-btn-default am-btn-xs am-text-secondary">
															<span class="am-icon-pencil-square-o"></span> 编辑
														</button>
														<button type="button" onclick="del('${model.fdId }')"
															class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
															<span class="am-icon-trash-o"></span> 删除
														</button>
													</div>
												</div>
											</td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<div class="am-cf">
								共 ${page.totalSize} 条记录
								<div class="am-fr">
									<ul class="am-pagination">

									</ul>
								</div>
							</div>
							<hr />
							<p>注：.....</p>
						</form>
					</div>

				</div>
			</div>
		</div>

	</div>

	<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
		<div class="am-modal-dialog">
			<div class="am-modal-bd">你，确定要删除这条记录吗？</div>
			<div class="am-modal-footer">
				<span class="am-modal-btn" data-am-modal-cancel>取消</span> <span
					class="am-modal-btn" data-am-modal-confirm>确定</span>
			</div>
		</div>
	</div>

	<%@ include file="/resources/jsp/foot.jsp"%>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		//初始化页数
		pagination("${page.totalPage}", "${page.pageNo}");
	});

	function add() {
		window.location.href = "${root}/sys/organization/addSysOrgPerson.do";
	}

	function edit(fdId) {
		window.location.href = "${root}/sys/organization/editSysOrgPerson.do?fdId="
				+ fdId;
	}

	function del(fdId) {
		$('#my-confirm')
				.modal(
						{
							relatedTarget : this,
							onConfirm : function(options) {
								$
										.ajax({
											type : "get",
											url : "${root}/sys/organization/delSysOrgPerson.do",
											data : {
												fdId : fdId
											},
											dataType : "json",
											success : function(data) {
												if (data == true) {
													window.location.href = "${root}/sys/organization/sysOrgPerson.do";
												}
											}
										});
							}
						});
	}
</script>
</html>